package com.bysj.sausys.activiti.common;

import com.bysj.sausys.util.SpringContextUtil;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;

/**
 * @author WangZK
 */
public class ActivitiUtil {

    public static ProcessInstance getProcessInstance(String processInstanceId) {
        RuntimeService runtimeService = SpringContextUtil.getBean("runtimeService");
        ProcessInstance processInstance = runtimeService.createProcessInstanceQuery()
                .processInstanceId(processInstanceId)
                .singleResult();
        return processInstance;
    }
}
